#ifndef MOTION_TASK_QUEUE_H
#define MOTION_TASK_QUEUE_H

#include <string>
#include <queue>
#include <vector>
#include <map>
#include <boost/asio/ip/tcp.hpp>
#include <mutex>

struct Data_Request {
	std::vector< std::string > DataNameList;
	boost::asio::ip::tcp::socket* reqSocket;
};

struct Motion_Request {
	std::string CmdStr;
	double targetX;
	double targetY;
	double targetZ;
	double targetR;
	int    moveSpeed;
	boost::asio::ip::tcp::socket* reqSocket;
};

struct Motion_Response {
	std::map<std::string, double> retData;
	boost::asio::ip::tcp::socket* reqSocket;
};

class MotionTaskQueue 
{
public:
	static MotionTaskQueue* instance();
	~MotionTaskQueue();

    void init();

public:
	std::queue< Data_Request > reqData;
	std::queue< Motion_Request >  reqMotion;
	std::queue< Motion_Response >  respMotion;

	std::mutex mtxReqData;
	std::mutex mtxReqMotion;
	std::mutex mtxRespMotion;

private:
	MotionTaskQueue();
};

#endif // INFERQUEUE_H
